# Build
FROM node:18-alpine AS build-stage
WORKDIR /app

COPY package*.json ./
RUN npm config set registry "https://registry.npmmirror.com"
RUN npm install --force
COPY . .

RUN npm run build

# Deploy
FROM nginx:alpine
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
